/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * conversorMoeda.java
 *
 * Created on 26/10/2011, 17:54:51
 */

package br.com.fatecpg.tp1.formularios;

/**
 *
 * @author india
 */
public class conversorMoeda extends javax.swing.JInternalFrame {

    /** Creates new form conversorMoeda */
    public conversorMoeda() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel2 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        BotaoReal = new javax.swing.JRadioButton();
        BotaoPeso = new javax.swing.JRadioButton();
        BotaoEuro = new javax.swing.JRadioButton();
        QteTextField = new javax.swing.JTextField();
        BotaoLibra = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        BotaoDolar = new javax.swing.JRadioButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        RealLabel = new javax.swing.JLabel();
        dolarLabel = new javax.swing.JLabel();
        PesoLabel = new javax.swing.JLabel();
        EuroLabel = new javax.swing.JLabel();
        LibraLabel = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(63, 98, 104));
        setClosable(true);
        setIconifiable(true);
        setTitle("Conversor de Moeda: Thais e Sandra");

        jPanel2.setBackground(new java.awt.Color(63, 82, 104));

        jPanel1.setBackground(new java.awt.Color(122, 167, 175));

        jLabel2.setText("Selecione a moeda");

        BotaoReal.setBackground(new java.awt.Color(122, 167, 175));
        buttonGroup1.add(BotaoReal);
        BotaoReal.setText("Real");
        BotaoReal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoRealActionPerformed(evt);
            }
        });

        BotaoPeso.setBackground(new java.awt.Color(122, 167, 175));
        buttonGroup1.add(BotaoPeso);
        BotaoPeso.setText("Peso");
        BotaoPeso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoPesoActionPerformed(evt);
            }
        });

        BotaoEuro.setBackground(new java.awt.Color(122, 167, 175));
        buttonGroup1.add(BotaoEuro);
        BotaoEuro.setText("Euro");
        BotaoEuro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoEuroActionPerformed(evt);
            }
        });

        BotaoLibra.setBackground(new java.awt.Color(122, 167, 175));
        buttonGroup1.add(BotaoLibra);
        BotaoLibra.setText("Libra");
        BotaoLibra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoLibraActionPerformed(evt);
            }
        });

        jLabel1.setText("Quantidade");

        BotaoDolar.setBackground(new java.awt.Color(122, 167, 175));
        buttonGroup1.add(BotaoDolar);
        BotaoDolar.setText("Dolar");
        BotaoDolar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoDolarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(24, 24, 24)
                        .addComponent(QteTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BotaoDolar)
                            .addComponent(BotaoPeso)
                            .addComponent(BotaoEuro)
                            .addComponent(BotaoLibra)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BotaoReal))
                    .addComponent(jLabel2))
                .addContainerGap(34, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(QteTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addComponent(jLabel2)
                .addGap(14, 14, 14)
                .addComponent(BotaoReal)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BotaoDolar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BotaoPeso)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BotaoEuro)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BotaoLibra)
                .addContainerGap(11, Short.MAX_VALUE))
        );

        jPanel3.setBackground(new java.awt.Color(122, 167, 175));

        jLabel3.setText("Resultados:");

        jLabel4.setText("Em Real:");

        RealLabel.setText("...");

        dolarLabel.setText("...");

        PesoLabel.setText("...");

        EuroLabel.setText("...");

        LibraLabel.setText("...");

        jLabel8.setText("Em Libra:");

        jLabel7.setText("Em Euro:");

        jLabel6.setText("Em Peso:");

        jLabel5.setText("Em Dolar:");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 162, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel5)
                                .addComponent(jLabel4)
                                .addComponent(jLabel6)
                                .addComponent(jLabel7)
                                .addComponent(jLabel8))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(dolarLabel)
                                .addComponent(RealLabel)
                                .addComponent(PesoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(EuroLabel)
                                .addComponent(LibraLabel)))
                        .addComponent(jLabel3))
                    .addContainerGap(72, Short.MAX_VALUE)))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 215, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel3)
                    .addGap(14, 14, 14)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel4)
                        .addComponent(RealLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel5)
                        .addComponent(dolarLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6)
                        .addComponent(PesoLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(EuroLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel8)
                        .addComponent(LibraLabel))
                    .addContainerGap(62, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(21, 21, 21))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BotaoRealActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoRealActionPerformed

        double r1 = Double.parseDouble(QteTextField.getText());
        double resReal = r1 * 1;
        RealLabel.setText(Double.toString(resReal));

        double d1 = Double.parseDouble(QteTextField.getText());
        double resDolar = d1 * 0.57;
        dolarLabel.setText(Double.toString(resDolar));

        double e1 = Double.parseDouble(QteTextField.getText());
        double resEuro = e1 * 0.41;
        EuroLabel.setText(Double.toString(resEuro));

        double l1 = Double.parseDouble(QteTextField.getText());
        double resLibra = l1 * 0.36;
        LibraLabel.setText(Double.toString(resLibra));

        double p1 = Double.parseDouble(QteTextField.getText());
        double resPeso = p1 * 1.66;
        PesoLabel.setText(Double.toString(resPeso));

    }//GEN-LAST:event_BotaoRealActionPerformed

    private void BotaoPesoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoPesoActionPerformed
        double r1 = Double.parseDouble(QteTextField.getText());
        double resReal = r1 * 0.61;
        RealLabel.setText(Double.toString(resReal));

        double d1 = Double.parseDouble(QteTextField.getText());
        double resDolar = d1 * 0.35;
        dolarLabel.setText(Double.toString(resDolar));

        double e1 = Double.parseDouble(QteTextField.getText());
        double resEuro = e1 * 0.25;
        EuroLabel.setText(Double.toString(resEuro));

        double l1 = Double.parseDouble(QteTextField.getText());
        double resLibra = l1 * 0.21;
        LibraLabel.setText(Double.toString(resLibra));

        double p1 = Double.parseDouble(QteTextField.getText());
        double resPeso = p1 * 1;
        PesoLabel.setText(Double.toString(resPeso));
    }//GEN-LAST:event_BotaoPesoActionPerformed

    private void BotaoEuroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoEuroActionPerformed
        double r1 = Double.parseDouble(QteTextField.getText());
        double resReal = r1 * 2.46;
        RealLabel.setText(Double.toString(resReal));

        double d1 = Double.parseDouble(QteTextField.getText());
        double resDolar = d1 * 1.40;
        dolarLabel.setText(Double.toString(resDolar));

        double e1 = Double.parseDouble(QteTextField.getText());
        double resEuro = e1 * 1;
        EuroLabel.setText(Double.toString(resEuro));

        double l1 = Double.parseDouble(QteTextField.getText());
        double resLibra = l1 * 0.87;
        LibraLabel.setText(Double.toString(resLibra));

        double p1 = Double.parseDouble(QteTextField.getText());
        double resPeso = p1 * 4.03;
        PesoLabel.setText(Double.toString(resPeso));
    }//GEN-LAST:event_BotaoEuroActionPerformed

    private void BotaoLibraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoLibraActionPerformed
        double r1 = Double.parseDouble(QteTextField.getText());
        double resReal = r1 * 2.84;
        RealLabel.setText(Double.toString(resReal));

        double d1 = Double.parseDouble(QteTextField.getText());
        double resDolar = d1 * 1.61;
        dolarLabel.setText(Double.toString(resDolar));

        double e1 = Double.parseDouble(QteTextField.getText());
        double resEuro = e1 * 1.16;
        EuroLabel.setText(Double.toString(resEuro));

        double l1 = Double.parseDouble(QteTextField.getText());
        double resLibra = l1 * 1;
        LibraLabel.setText(Double.toString(resLibra));

        double p1 = Double.parseDouble(QteTextField.getText());
        double resPeso = p1 * 4.66;
        PesoLabel.setText(Double.toString(resPeso));
    }//GEN-LAST:event_BotaoLibraActionPerformed

    private void BotaoDolarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoDolarActionPerformed


        double r1 = Double.parseDouble(QteTextField.getText());
        double resReal = r1 *1.76;
        RealLabel.setText(Double.toString(resReal));

        double d1 = Double.parseDouble(QteTextField.getText());
        double resDolar = d1 * 1;
        dolarLabel.setText(Double.toString(resDolar));

        double e1 = Double.parseDouble(QteTextField.getText());
        double resEuro = e1 * 0.72;
        EuroLabel.setText(Double.toString(resEuro));

        double l1 = Double.parseDouble(QteTextField.getText());
        double resLibra = l1 * 0.62;
        LibraLabel.setText(Double.toString(resLibra));

        double p1 = Double.parseDouble(QteTextField.getText());
        double resPeso = p1 * 2.89;
        PesoLabel.setText(Double.toString(resPeso));
    }//GEN-LAST:event_BotaoDolarActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton BotaoDolar;
    private javax.swing.JRadioButton BotaoEuro;
    private javax.swing.JRadioButton BotaoLibra;
    private javax.swing.JRadioButton BotaoPeso;
    private javax.swing.JRadioButton BotaoReal;
    private javax.swing.JLabel EuroLabel;
    private javax.swing.JLabel LibraLabel;
    private javax.swing.JLabel PesoLabel;
    private javax.swing.JTextField QteTextField;
    private javax.swing.JLabel RealLabel;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel dolarLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    // End of variables declaration//GEN-END:variables

}
